'use strict';

const Controller = require('egg').Controller;

class UserController extends Controller {
  async getuser() {
    const data = await this.service.user.find();
    this.ctx.body = data;
  }
  async adduser() {
    const { ctx } = this;
    const data = {
      name: '张三',
    };
    const res = await this.service.user.add(data);
    ctx.body = res;

  }
}

module.exports = UserController;
